package com.sc.nft.entity.vo.secondEquityProp;

import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class SecondEquityPropConfPageVO {

    @ApiModelProperty("二级配置id")
    private Long secondConfId;

    @ApiModelProperty("标题")
    private String firstTitle;

    @ApiModelProperty("缩略图")
    private String creationContent;

    @ApiModelProperty("销售价格(最低价)")
    private String salesPrice;

    @ApiModelProperty("寄售数量")
    private Integer consignCount;

    public void setSalesPrice(BigDecimal salesPrice) {
        if(ObjectUtil.isNull(salesPrice) || NumberUtil.equals( BigDecimal.ZERO,salesPrice)){
            this.salesPrice = "--";
            return;
        }

        this.salesPrice = salesPrice.setScale(2,BigDecimal.ROUND_DOWN).toPlainString();
    }
}
